//
//  JEHPicsModel.m
//  SinaNews
//
//  Created by 蒋恩浩 on 15/12/1.
//  Copyright © 2015年 JEH. All rights reserved.
//

#import "JEHPicsModel.h"

@implementation JEHPicsModel

- (void)dealloc
{
    [_listArray release];
    [super dealloc];
}

- (instancetype)initWithDictionary:(NSDictionary *)dictionary {
    
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dictionary];
    }
    return self;
}

- (id)valueForUndefinedKey:(NSString *)key {
    return nil;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"list"]) {
        NSArray *array = value;
        NSMutableArray *mutableArray = [NSMutableArray arrayWithCapacity:0];
        for (NSDictionary *dictionary in array) {
            JEHSecondModel *secondModel = [[JEHSecondModel alloc] initWithDictionary:dictionary];
            [mutableArray addObject:secondModel];
            [secondModel release];
        }
        self.listArray = [NSArray arrayWithArray:mutableArray];
    }
}

@end













